{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
<div class="form-group">
  <label class="control-label col-xs-2">Error To<span class="requiredField">&nbsp;*</span></label>
  <div class=" col-xs-7">
    <select onchange={{action "errorToHandler" value="target.value"}} name="select-node" class="form-control" data-show-icon="true">
      <optgroup label="Kill Nodes">
        {{#each killNodes as |node index|}}
        <option value={{node.name}} selected={{eq node.name transition.errorNode.name}}>{{node.name}}</option>
        {{/each}}
      </optgroup>
      <optgroup label="Other Nodes">
        {{#each descendantNodes as |node index|}}
        <option value={{node.name}} selected={{eq node.name transition.errorNode.name}}>{{node.name}}</option>
        {{/each}}
      </optgroup>
    </select>
    {{#if (eq transition.errorNode.type 'kill')}}
      <span class="kill-message">{{transition.errorNode.killMessage}}</span>
    {{/if}}
  </div>
</div>
<div class="form-group">
  <label class="control-label col-xs-2">Ok To<span class="requiredField">&nbsp;*</span></label>
  <div class=" col-xs-7">
    <select onchange={{action "okToHandler" value="target.value"}} name="select-node" class="form-control" data-show-icon="true">
      <optgroup label="Kill Nodes">
        {{#each killNodes as |node index|}}
        <option value={{node.name}} selected={{eq node.name transition.okToNode.name}}>{{node.name}}</option>
        {{/each}}
      </optgroup>
      <optgroup label="Other Nodes">
        {{#each currentNode.validOkToNodes as |node index|}}
          <option value={{node.name}} selected={{eq node.name transition.okToNode.name}}>{{node.name}}</option>
        {{/each}}
      </optgroup>
    </select>
    {{#if showWarning}}
      <span class="ok-to-warning">
        Changing Ok To transition may result in deletion of intermediate nodes. <span class="undo" {{action 'undoChangeOkTo'}}><u>Undo</u></span>
      </span>
    {{/if}}
  </div>
</div>

{{#if (eq selectedKillNode 'createNew')}}
<div class="form-group" id="killNodeName">
  <label class="control-label col-xs-2"> Kill node name</label>
  <div class=" col-xs-7">
    {{input class="form-control" type="text" name="kill-node-name" value=transition.errorNode.name}}
  </div>
</div>
<div class="form-group">
  <label class="control-label col-xs-2"> Kill message</label>
  <div class=" col-xs-7">
    {{textarea class="form-control" rows="5" placeholder="kill node message" name="kill-node-message" value=transition.errorNode.message}}
  </div>
</div>
{{/if}}
